package com.ly.controller;


import javax.servlet.http.HttpServletResponse;

import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ly.bean.Bis_coupon_record;
import com.ly.service.CouponRecordService;

@Controller
public class CouponRecordHandler {
	@Autowired
	private CouponRecordService service;
	
	@RequestMapping("querycouponrecordbyid")
	@ResponseBody
	public void querycouponrecordbyid(Integer active_id,Bis_coupon_record record,HttpServletResponse resp){
		record.setActive_id(active_id);
		
		String jsonStr="";
		try {
			jsonStr = new ObjectMapper().writeValueAsString(service.querycouponrecord(record));
			resp.getWriter().write(jsonStr);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		 
	}
}
